home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / infor / tsptp.zip / TSBENCH.ITF < prev    next >
Text File  |  1993-04-09  |  4KB  |  110 lines

  1. (******************************************************************************)
  2. (*                                 TIMER.ITF                                  *)
  3. (*                                                                            *)
  4. (* Benchmark types and timer routines used by the TopSpeed Pascal benchmarks. *)
  5. (*                                                                            *)
  6. (******************************************************************************)
  7.  
  8. INTERFACE UNIT TSBench;
  9.  
  10.   TYPE
  11.     (*** Benchmarking types.  Note that Turbo 6-byte Reals have no exact    ***)
  12.     (*** equivalent in TopSpeed Pascal.  The TopSpeed Emulator however,     ***)
  13.     (*** support 4, 8, and 10 byte floating point reals and an 8 byte fixed ***)
  14.     (*** point real that are equivalent to the Turbo Single, Double,        ***)
  15.     (*** Extended and Comp types respectively.  Because of this floating    ***)
  16.     (*** point benchmarks should be run on a system with a coprocessor for  ***)
  17.     (*** comparison.                                                        ***)
  18.  
  19.     BmInt     = INTEGER;            (* -214783647..214783647, signed 32-bit   *)
  20.     BmReal    = REAL;               (* 2.03E-308..1.7E+308, 8 bytes           *)
  21.  
  22.     (*** Timing                                                             ***)
  23.  
  24.     BmTimeT   = INTEGER;            (* Suitable type for max seconds          *)
  25.     BmCounter = INTEGER;            (* Suitable type for max loops            *)
  26.  
  27.   CONST
  28.     MINNULLTIME   = 1;              (* Null loop time in seconds              *)
  29.     MINBENCHTIME  = 60;             (* Bench loop time in seconds, 60 is good *)
  30.  
  31.   VAR
  32.     DummyVar : BOOLEAN;             (* Global variable for side-effects       *)
  33.  
  34. (** STARTTIMER ****************************************************************
  35.  *
  36.  *  Synopsis:
  37.  *
  38.  *    StartTimer;
  39.  *
  40.  *  Description:
  41.  *
  42.  *    StartTime starts the benchmark timer.
  43.  *)
  44.  
  45.   PROCEDURE StartTimer;
  46.  
  47.  
  48. (** NULLTIMESUP ***************************************************************
  49.  *
  50.  *  Synopsis:
  51.  *
  52.  *    NullTimesUp;
  53.  *
  54.  *  Description:
  55.  *
  56.  *    NullTimesUp stops the timer when the NULL timing loop is complete.
  57.  *)
  58.  
  59.   FUNCTION NullTimesUp: BOOLEAN;
  60.  
  61. (** BENCHTIMESUP **************************************************************
  62.  *
  63.  *  Synopsis:
  64.  *
  65.  *    BenchTimesUp;
  66.  *
  67.  *  Description:
  68.  *
  69.  *    BenchTimesUp stops the timer when the NULL timing loop is complete.
  70.  *)
  71.  
  72.   FUNCTION BenchTimesUp: BOOLEAN;
  73.  
  74.  
  75. (** REPORTTIMES ***************************************************************
  76.  *
  77.  *  Synopsis:
  78.  *
  79.  *    ReportTimes;
  80.  *
  81.  *  Description:
  82.  *
  83.  *    ReportTimes reports the benchmark times and stats.  Note that the
  84.  *    calculated results for LoopOverhead, TotalTime and Loops per second
  85.  *    are prone to any floating point errors.  Therefore you may wish to
  86.  *    check these results manually.
  87.  *)
  88.  
  89.   PROCEDURE ReportTimes;
  90.  
  91.  
  92. (** DUMMY *********************************************************************
  93.  *
  94.  *  Synopsis:
  95.  *
  96.  *    Dummy;
  97.  *
  98.  *  Description:
  99.  *
  100.  *    Dummy is a dummy procedure used to calculate the looping overhead in a
  101.  *    benchmark.  In order to prevent it being optimised out of existence it
  102.  *    must introduce a side effect.  In this case we modify the exported
  103.  *    variable DummyVar.
  104.  *)
  105.  
  106.   PROCEDURE Dummy;
  107.  
  108. (*# restore                                                                   *)
  109. END.
  110.